﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Mapa.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">

    
    <div id="map3d" style="height: 400px; width: 100%;"></div> 

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContentPlaceHolder" runat="server">

    <script src="http://www.google.com/jsapi?key=ABQIAAAA3h-vyP_6IePyY5uOJxHE7xQLyozoXpHWq4B17xiQz7RwuyV7WBQE9Z-5SVWXfnZJ4BsxpiPPG_oifg" 
    type="text/javascript"> </script>
        
    <script type="text/javascript">

        var ge; google.load("earth", "1");
        function init() {
           

            google.earth.createInstance('map3d', initCB, failureCB);
        }
        //funcion q muestra los componentes del Earth
        function initCB(instance) {

            ge = instance;
            ge.getWindow().setVisibility(true);
            
            //control de la rotacion y zoom desaparece y aparece automaticamente
            ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);
            //subir capas del earth
            ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
            ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);

            // crear el placemark
            placemark = ge.createPlacemark('');
            //-0.177433,-78.489547
            var point = ge.createPoint('');
            point.setLatitude(-0.177433);
            point.setLongitude(-78.489547);
            placemark.setGeometry(point);

            // add the placemark to the earth DOM
            ge.getFeatures().appendChild(placemark);

            // look at the placemark we created
            var la = ge.createLookAt('');
            la.set(-0.177433, -78.489547,
                    0, // altitude
                    ge.ALTITUDE_RELATIVE_TO_GROUND,
                    0, // heading
                    85, // straight-down tilt
                    500 // range (inverse of zoom)
                    );
            ge.getView().setAbstractView(la);


            document.getElementById('installed-plugin-version').innerHTML =
            ge.getPluginVersion().toString();


        }
        function failureCB(errorCode) {
        }
        google.setOnLoadCallback(init);   
         
     </script> 


</asp:Content>
